package nonSpecialCount

import "math"

func nonSpecialCount(l int, r int) int {

	n := int(math.Sqrt(float64(r)))
	noZS := make([]int, n+1)
	count := r - l + 1

	for i := 2; i <= n; i += 1 {

		if noZS[i] == 0 {

			tmp := i * i
			if tmp >= l && tmp <= r {
				count -= 1
			}
			x := i
			j := x * i
			for j <= n {
				noZS[j] = 1
				j += i
			}

		}
	}
	return count

}
